package com.android.woodpecker;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.RelativeLayout;
import android.widget.RelativeLayout.LayoutParams;

public class MainMenu extends Activity{
	
	RelativeLayout rl;
	Button Bplay, Bhelp, Bhighscore;
	int height, width;
	
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		
		DisplayMetrics displaymetrics = new DisplayMetrics();
		getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
		int height = displaymetrics.heightPixels;
		int wwidth = displaymetrics.widthPixels;
		
		rl = new RelativeLayout(this);
		rl.setBackgroundColor(Color.rgb(0, 0, 0));
		
		Bplay = new Button(this);
		Bplay.setTextColor(Color.BLACK);
		Bplay.setTextSize(15.0f);
		Bplay.setText("FreePlay");
		Bplay.setId(1);
		LayoutParams paramsBplay = new RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
		paramsBplay.topMargin = height/6;
		Bplay.setLayoutParams(paramsBplay);
		
		Bhelp = new Button(this);
		Bhelp.setTextColor(Color.BLACK);
		Bhelp.setTextSize(15.0f);
		Bhelp.setText("Help");
		Bhelp.setId(2);
		LayoutParams paramsBhelp = new RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
		paramsBhelp.addRule(RelativeLayout.BELOW, Bplay.getId());
		paramsBhelp.topMargin = height/6;
		Bhelp.setLayoutParams(paramsBhelp);
		
		Bhighscore = new Button(this);
		Bhighscore.setTextColor(Color.BLACK);
		Bhighscore.setTextSize(15.0f);
		Bhighscore.setText("High Score");
		Bhighscore.setId(3);
		LayoutParams paramsBhighscore = new RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
		paramsBhighscore.addRule(RelativeLayout.BELOW, Bhelp.getId());
		paramsBhighscore.topMargin = height/6;
		Bhighscore.setLayoutParams(paramsBhighscore);
		
		rl.addView(Bplay);
		rl.addView(Bhelp);
		rl.addView(Bhighscore);
		
		setContentView(rl);
		Bplay.setOnClickListener(new OnClickListener(){

			public void onClick(View v) {
				
				Intent beginGame = new Intent(MainMenu.this, FreePlayMenu.class);
				startActivity(beginGame);
				
			}
			
		});
		
	}

}
